package com.nbgs.demo.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号,开发时使用沙箱提供的APPID，生产环境改成自己的APPID
    public static String APP_ID = "2016103100781178";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String APP_PRIVATE_KEY = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCDt+hBz4LuKkPaVUfbz7xkQud/fY2AP/FZmf84si/v5zXo1PiBQrExOrrCltV7Icc3whwQaiB/etMbXaZvzHLCYgz8+MBJTI6xKv9v7FMVC6teKGzNN0MYobtgPJK/TF/W212T1HC+OsGV1p6iKQuHFpMck/GPEk1QmuqEs7mMGI9weeaG4ZTq0ihweqg607ketJ5P9RPLWDtgabTpptEDodYwJbfaEyf58zxF4QiL/2valoc4riQLjNpcJDq9uxOEdxicbpSjTl+9VU2nIDqEZpissY38enaN+Hjptmay8EbIH4i7piC0t6/U69NjOctgJNmHfyEU8W6JCl8f4sHxAgMBAAECggEAIbLoggXUKpi3mWFeLBeezEvtrElz7U7usYzbpia4avlNao8qMO/eI4kyBNzQK1t9+3727SApxlOnNQYlsc6twZuSVRpTH62tiBhHF9xveR/uLP3MsEgmK2Qda0a0CKtCjda7vzmHyrN/mZU6KqSzpVEaPCKBl6gIDcpEm8TbgMLbqfj1yi+3tdd6q9p2MoCY7aOgwvnijXHgY1Z7OfVrBlLxNNFZGKdmBb9nGprvfqju+pxXLcXVoAiG9KZw2h9TcfoFK3qLHDvj8n6Ke2J1LwTiHEzKql1HHt/u8PpR2s8AFo9Gd/kQdLb06zM2i+xDnXUinzr/6lYPeXswMlQmAQKBgQDkGU9zYARUr8OFLtrJl0YAESfG/5m2jqgCZwq83qpmXOkW3svh1Klt6e+Dihizv3EdOIojHCLTqXXToe24nhIxipQlJGDXpwXncbVnPZlL9hhwX8XoaFBn2ia4Rq4fEqzfQ3x3ZKRqViFU0lAn5hZGMOWeJM03w2IX7+EPCDxKIQKBgQCT1ImuNN9j17Rw+TS3rN7KMgRiUhKDGM1D13pSGkZYTY56KDHpShi4IvSrZ4Ryo5mv+ViwW8y3ZiI3y9tVuxIh2mlyBLz58GeNjtewo5+BOqaDCTFYnCZ+GJZ/9mwyWwo+AsqoTpIQylvDHvGSboucHxjgmI0g29flJexKjrSd0QKBgAXytwSuM062CqY1c5UgMb4ctGnXDn4ZOD5fy4LjV5Q1xgpHow9viT+Jgypt9njxfBSj/c4ulKXqXF05csaGsLjEAVr6mN/mxhuj9nQLwiyd7UM47CNEXRxoLuxNQ4sh5Iop61v9rt/rARGCLn7r3BbWfZZjJUrX+H3hToAi2dehAoGAbb9mD2y1Q5xKG20HVC0EoTuMwamIkMcC7JC2AOn8u2WolsvscfNOcrWQywdo7urCGECXNSaRzr4GPUIcrYLaLUPG8JzP5wYw+ojHXB29NuVh5PoYJl6WvRpn8Mvy+1dXPT45UcYy7kAs66i3Uyy6fMchYuweKfzMRRRoXdmgAWECgYBoxFB1LqmeIzWLB3VZDKhltbYHuXWdmqYyIoeKBbOihSul6twxYqhZ0FAX3qDHyPq2KvZKmqALy7xJU8YFxH+pPenjbwGkcZTrLVFGBJ0sEyObV1n9MzB/ELg3+WWP1Z11HKwuZYtcJlWYP8mUL7jonInjKM0Q6hTEae/AaqUEmw==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnoZRxA5M9oM4mv5xF9u4MYlFeyw/vnI+s6KAkIjUMkbqcekQwxV6Jho4h3nMDIqmwhYCDPscfM0GgZCN7pH7VPQJRPVKWw3qMT7sYcdTaNd/cv0bvXCd5cIdADlLymS5CKyFKy/JmH0KGYbDlp7dUEjdv03lbt1af4rBfw1O75y5YoL2CDUFOCMg+jbgblWlRSOowr6QGb72NSt8UgZDidofpCZLieHsFHhSVZTFBNNR/AeBqGhXuFFFjh2RufBEBb2paGS5kIhY+s3B+xBXSFLkawmGZ0E77uaKA1MS33MaNl4oUSgHLIRh5N2utnvKQeWCC47mgUYuBEvxAk5BGQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://353156nr65.qicp.vip:59352/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问(其实就是支付成功后返回的页面)
    public static String return_url = "http://192.168.120.17:8080/#waterBill";
//    http://192.168.120.5:8080/#/waterBill
    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String CHARSET = "utf-8";

    // 支付宝网关，这是沙箱的网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
